import config from "@/config";
import http from "@/utils/request";

export default {
	set: {
		url: `${config.API_URL}/language/set`,
		name: "新增、更新",
		post: async function (data) {
			return await http.post(this.url, data);
		},
	},

	remove: {
		url: `${config.API_URL}/language/remove`,
		name: "删除",
		post: async function (data) {
			return await http.post(this.url, data);
		},
	},
	disable: {
		url: `${config.API_URL}/language/disable`,
		name: "禁用",
		post: async function (data) {
			return await http.post(this.url, data);
		},
	},

	detail: {
		url: `${config.API_URL}/language/detail`,
		name: "详情",
		get: async function (data) {
			return await http.get(this.url + "/" + data);
		},
	},
	all: {
		url: `${config.API_URL}/language/list/all`,
		name: "运行语言列表",
		get: async function () {
			return await http.get(this.url);
		},
	},
	available: {
		url: `${config.API_URL}/language/list/available`,
		name: "运行语言列表-可用",
		get: async function () {
			return await http.get(this.url);
		},
	},

	codeList: {
		url: `${config.API_URL}/language/code/list`,
		name: "运行语言扩展类库列表",
		get: async function (data) {
			return await http.get(this.url + "/" + data);
		},
	},

	codeSet: {
		url: `${config.API_URL}/language/set/code`,
		name: "运行语言扩展类库设置",
		post: async function (data) {
			return await http.post(this.url, data);
		},
	},
	codeRemove: {
		url: `${config.API_URL}/language/remove/code`,
		name: "运行语言扩展类库删除",
		post: async function (data) {
			return await http.post(this.url, data);
		},
	},
	codeListByLang: {
		url: `${config.API_URL}/language/code/list/byLang`,
		name: "运行语言扩展类库列表-根据语言code",
		get: async function (data) {
			return await http.get(this.url + "?lang=" + data);
		},
	},
};
